<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport"
        content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="css/mui.min.css" />
    <link rel="stylesheet" href="css/reset.css" />
    <link rel="stylesheet" href="css/login.css" />
    <script src="js/vue.js"></script>
    <script src="js/axios.js"></script>
    <title>登录</title>
</head>

<body>
    <div id="app" class="content">
        <div class="outside">
            <!-- 头像 -->
            <div class="userImg">
                <img src="./images/logo.png" alt="">
            </div>
            <!-- 手机号 -->
            <input v-model='userTel' type="text" name='tele' placeholder="请输入手机号">
            <!-- 密码 -->
            <input v-model='userPwd' type="password" name='passwrd' placeholder="请输入登录密码">
            <!-- 提交 -->
            <button type="button" @click='submit'>登录</button>
            <div class="aBox">
                <a href="forgetpassword.html" class="forgetPwd">忘记密码</a>
            </div>
            <!-- 注册链接 -->
            <div class="registerA">
                <a href="register.html">还没账号？立即注册</a>
            </div>
        </div>
    </div>

    <script src="js/mui.min.js"></script>
    <script type="text/javascript" charset="utf-8">
        const API_PROXY = 'https://bird.ioliu.cn/v1/?url='
        new Vue({
            el: '#app',
            data: {
                userTel: '',
                userPwd: ''
            },
            methods: {
                submit() {
                    axios.post(API_PROXY + 'mingpian.32one.top/Index/Login/login', {
                        account: this.userTel,
                        password: this.userPwd
                    }).then(res => {
                        if (res.data.code == 0) {
                            mui.toast(res.data.msg)
                            setTimeout(function () {
                                window.location.href = 'homepage.html'
                            }, 2000)
                        } else {
                            mui.toast(res.data.msg)
                        }
                    })
                }
            }
        })
    </script>
</body>

</html>